<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'ShowAllUser.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<script src="<%=path %>/js/jquery.min.js" type="text/javascript"></script>
	<script src="<%=path %>/js/dataTables.bootstrap.js" type="text/javascript"></script>
	<script src="<%=path %>/js/jquery.dataTables.js" type="text/javascript"></script>
	
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<script type="text/javascript">
	var msg ='<%=session.getAttribute("tipMessage")%>';
	if (msg != ""&&msg!=null) {
	<%session.setAttribute("tipMessage","");%>
		alert(msg);
		
	}
	
	$(function() {
		$.ajax({
			url : 'showalluser',
			dataType : 'json',
			type : 'post',
			error : function() {
				alert("操作错误！");
			},
			success : function(responseResult) {
				var content = "";
				$(responseResult.userlist).each(
					function(i){
						content += "<tr><td><input type='checkbox' name='delectcb' value='"+this.username+"' /></td>"
								+"<td>"+this.username+"</td>"
								+"<td>"+this.name+"</td>"
								+"<td>"+this.phone+"</td>"
								+"<td>"+this.role+"</td>"
								+"<td><a href='showoneinfo?user.username="+this.username+"'>"
								+"修改 </a>"
								+"<a href='initpsw?user.username="+this.username+"'>"
								+"重置密码 </a>"
								+"</td></tr>";
					}
				);
				$("#AllUser").append(content);
				$("#ImptOrderList").DataTable({
	      			"paging": true,
				      "lengthChange": false,
				      "searching": false,
				      "ordering": false,
				      "info": true,
				      "autoWidth": true,
				      "iDisplayLength":4,
				      "bInfo":false,
				      "bDestroy":true,
				      "bRetrieve":true
	    		});
				
			}
		});
		
	});
</script>
  </head>
  
  <body>
  <br>
  <br>
  <div align=center><FONT SIZE="6" COLOR="颜色#000000">用户管理</FONT></div>
  <br>
  <br> 
  <div align=center>
  <form action="delectmanyuser" method="post">
    <table class="table table-hover TableList ImptOrderList" id="ImptOrderList">
    <tr>
 
    <th><input type="submit" value="删除" /></th>
     </tr>
  	<tr border=1>
  	<th>选择</th>
  		<th>用户名</th>
  		<th>姓名</th>
  		<th>电话</th>
  		<th>身份</th>
  		<th>操作</th>
  		
  	</tr>
  	<tbody id="AllUser">
  	
  	</tbody>
	<%-- <s:iterator value="userlist" id="user">
								<tr>
									<td><input type="checkbox" name="delectcb" value="<s:property value="#user.username" />"></td>													
									<td><s:property value="#user.username" /></td>	
									<td><s:property value="#user.name" /></td>	
									<td><s:property value="#user.phone" /></td>	
									<td><s:property value="#user.role" /></td>							
									<td><a href="<s:url action="showoneinfo">
						       <s:param name="user.username" value="#user.username"></s:param></s:url>"
													>修改</a>
													<a href="<s:url action="initpsw">
						       <s:param name="user.username" value="#user.username"></s:param></s:url>"
													onclick="return confirm('确定重置密码？')?true:false;">重置密码</a>
													
													
											</td>
					
								</tr>
	</s:iterator> --%>
	
  

  	</table>
  	</form>
  	</div>
  </body>
</html>